﻿<Grid x:Class="Daytimer.Controls.Ribbon.Backstage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
		xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
		xmlns:ext="clr-namespace:Microsoft.Windows.Shell;assembly=Microsoft.Windows.Shell"
		xmlns:Ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
		xmlns:Friction="clr-namespace:Daytimer.Controls.Friction" mc:Ignorable="d" d:DesignHeight="300"
		d:DesignWidth="600" Margin="1" SnapsToDevicePixels="False" UseLayoutRounding="True">
	<Grid x:Name="mainGrid" ClipToBounds="True">
		<Grid x:Name="background" ClipToBounds="True" VerticalAlignment="Top" HorizontalAlignment="Right" Height="54"
				Visibility="{DynamicResource BackgroundVisibility}" Margin="0,-1,-1,0" IsHitTestVisible="False">
			<Image x:Name="copyBackgroundImage" HorizontalAlignment="Right" />
			<Image x:Name="backgroundImage" HorizontalAlignment="Right" />
		</Grid>
		<Grid x:Name="clientGrid" RenderTransformOrigin="0.5,0.5" ClipToBounds="True" SnapsToDevicePixels="False">
			<Grid.CacheMode>
				<BitmapCache SnapsToDevicePixels="False" />
			</Grid.CacheMode>
			<Grid.RenderTransform>
				<TranslateTransform x:Name="clientGridTranslate" X="0" />
			</Grid.RenderTransform>
			<Grid.ColumnDefinitions>
				<ColumnDefinition />
				<ColumnDefinition Width="Auto" />
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="57" />
				<RowDefinition />
				<RowDefinition Height="Auto" />
			</Grid.RowDefinitions>
			<Rectangle x:Name="PART_MenuBackground" Fill="{DynamicResource WindowBorderFocused}" Grid.RowSpan="2"
					Width="{Binding ActualWidth,ElementName=PART_ItemsStackPanel}" HorizontalAlignment="Left"
					IsHitTestVisible="False" />
			<Friction:FrictionScrollViewer x:Name="PART_ScrollViewer" Grid.Row="1" Focusable="False"
					HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Background="Transparent"
					ScrollChanged="PART_ScrollViewer_ScrollChanged" ext:WindowChrome.IsHitTestVisibleInChrome="True">
				<Grid ClipToBounds="True">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto" />
						<ColumnDefinition />
					</Grid.ColumnDefinitions>
					<StackPanel x:Name="PART_ItemsStackPanel" Orientation="Vertical" Margin="0,13,0,0" MinWidth="123">
						<StackPanel.Resources>
							<Style TargetType="RadioButton">
								<Setter Property="Height" Value="38" />
								<Setter Property="Foreground" Value="White" />
								<Setter Property="GroupName" Value="_backstageRadio" />
								<Setter Property="ClickMode" Value="Press" />
								<Setter Property="Template">
									<Setter.Value>
										<ControlTemplate TargetType="RadioButton">
											<Border x:Name="OuterBorder" Padding="26,0" Background="Transparent">
												<ContentPresenter RecognizesAccessKey="True" VerticalAlignment="Center" />
											</Border>
											<ControlTemplate.Triggers>
												<Trigger Property="IsKeyboardFocused" Value="True">
													<Setter Property="Background" TargetName="OuterBorder"
															Value="{DynamicResource BackstageRadioMouseOver}" />
												</Trigger>
												<Trigger Property="IsChecked" Value="True">
													<Setter Property="Background" TargetName="OuterBorder"
															Value="{DynamicResource BackstageRadioChecked}" />
												</Trigger>
												<!--<Trigger Property="IsKeyboardFocused" Value="True">
													<Setter Property="Background" TargetName="OuterBorder"
															Value="#FF0067B0" />
												</Trigger>-->
												<Trigger Property="IsMouseOver" Value="True">
													<Setter Property="Background" TargetName="OuterBorder"
															Value="{DynamicResource BackstageRadioMouseOver}" />
												</Trigger>
												<Trigger Property="IsEnabled" Value="False">
													<Setter Property="Foreground"
															Value="{DynamicResource BackstageRadioDisabled}" />
												</Trigger>
											</ControlTemplate.Triggers>
										</ControlTemplate>
									</Setter.Value>
								</Setter>
								<Setter Property="FocusVisualStyle">
									<Setter.Value>
										<Style>
											<Setter Property="Control.Template">
												<Setter.Value>
													<ControlTemplate />
												</Setter.Value>
											</Setter>
										</Style>
									</Setter.Value>
								</Setter>
							</Style>
							<Style TargetType="Separator">
								<Setter Property="Margin" Value="26,11" />
								<Setter Property="IsHitTestVisible" Value="False" />
								<Setter Property="Template">
									<Setter.Value>
										<ControlTemplate TargetType="Separator">
											<Rectangle Height="1" Fill="{DynamicResource BackstageRadioChecked}" />
										</ControlTemplate>
									</Setter.Value>
								</Setter>
							</Style>
						</StackPanel.Resources>
						<RadioButton x:Name="infoButton" Content="_Info" Checked="infoButton_Checked" />
						<Separator />
						<RadioButton x:Name="importButton" Content="I_mport" Checked="importButton_Checked" />
						<RadioButton x:Name="exportButton" Content="_Export" Checked="exportButton_Checked" />
						<RadioButton x:Name="printButton" Content="_Print" Checked="printButton_Checked" />
						<Separator />
						<RadioButton x:Name="feedbackButton" Content="Fee_dback" Checked="feedbackButton_Checked" />
						<Separator Visibility="{Binding Visibility, ElementName=feedbackButton}" />
						<RadioButton x:Name="accountsButton" Content="_Cloud" Checked="accountsButton_Checked" />
						<RadioButton x:Name="optionsButton" Content="Op_tions" Checked="optionsButton_Checked" />
						<Separator />
						<RadioButton x:Name="exitButton" Content="E_xit" ClickMode="Release" Click="exitButton_Click" />
					</StackPanel>
					<Border x:Name="PART_Content" Grid.Column="1" TextElement.Foreground="#FF5E5E5E" ClipToBounds="True"
							Background="Transparent">
						<Border.Resources>
							<ResourceDictionary>
								<ResourceDictionary.MergedDictionaries>
									<ResourceDictionary Source="BackstageTabControl.xaml" />
								</ResourceDictionary.MergedDictionaries>
								<Style TargetType="TextBlock">
									<Setter Property="HorizontalAlignment" Value="Left" />
									<Setter Property="VerticalAlignment" Value="Center" />
									<Setter Property="IsHitTestVisible" Value="False" />
								</Style>
								<Style TargetType="BulletDecorator">
									<Setter Property="Background" Value="#FFB3B3B3" />
									<Setter Property="Height" Value="7" />
									<Setter Property="Width" Value="7" />
									<Setter Property="HorizontalAlignment" Value="Left" />
									<Setter Property="VerticalAlignment" Value="Center" />
									<Setter Property="Margin" Value="3,0,15,0" />
									<Setter Property="IsHitTestVisible" Value="False" />
								</Style>
							</ResourceDictionary>
						</Border.Resources>
					</Border>
					<Image x:Name="PART_ContentScreenshot" Grid.Column="1" Stretch="None" HorizontalAlignment="Left"
							VerticalAlignment="Top" IsHitTestVisible="False" />
				</Grid>
			</Friction:FrictionScrollViewer>
			<Button x:Name="PART_Back" Padding="23,2,2,2" Margin="0" Height="39" Width="60" HorizontalAlignment="Left"
					VerticalAlignment="Bottom"
					Content="F1 M 17.5 5.25 17.5 7.75 4.5 7.75 10 13 6.5 13 0 6.5 6.5 0 10 0 4.5 5.25 0.5 5.25 Z"
					Style="{StaticResource RoundMetroButton}" ext:WindowChrome.IsHitTestVisibleInChrome="True"
					PreviewMouseLeftButtonDown="PART_Back_PreviewMouseLeftButtonDown" />
			<!-- ScrollBar space -->
			<Rectangle Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" IsHitTestVisible="False"
					Width="{Binding ActualWidth, ElementName=verticalRect, Mode=OneWay}"
					Visibility="{Binding Visibility, ElementName=PART_VerticalScrollBar}" />
			<Rectangle Grid.Row="2" Grid.ColumnSpan="2" IsHitTestVisible="False"
					Height="{Binding ActualHeight, ElementName=horizontalRect, Mode=OneWay}"
					Visibility="{Binding Visibility, ElementName=PART_HorizontalScrollBar}" />
		</Grid>
		<Grid x:Name="scrollBars" ext:WindowChrome.IsHitTestVisibleInChrome="True">
			<Grid.ColumnDefinitions>
				<ColumnDefinition />
				<ColumnDefinition Width="Auto" />
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="57" />
				<RowDefinition />
				<RowDefinition Height="Auto" />
			</Grid.RowDefinitions>
			<Rectangle x:Name="verticalRect" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" IsHitTestVisible="False"
					Fill="{DynamicResource White}" Visibility="{Binding Visibility, ElementName=PART_VerticalScrollBar}" />
			<ScrollBar x:Name="PART_VerticalScrollBar" Grid.Column="1" Grid.Row="1" Margin="1,2,1,3"
					Visibility="Collapsed" Scroll="PART_VerticalScrollBar_Scroll" />
			<Rectangle x:Name="horizontalRect" Grid.Row="2" Grid.ColumnSpan="2" IsHitTestVisible="False"
					Fill="{DynamicResource White}"
					Visibility="{Binding Visibility, ElementName=PART_HorizontalScrollBar}" />
			<ScrollBar x:Name="PART_HorizontalScrollBar" Orientation="Horizontal" Grid.Row="2" Margin="2,1"
					Visibility="Collapsed" Scroll="PART_HorizontalScrollBar_Scroll" />
		</Grid>
		<Grid x:Name="captionGrid" VerticalAlignment="Top" Height="31" Margin="0,-1,0,0">
			<Grid.ColumnDefinitions>
				<!-- Space for sidebar -->
				<ColumnDefinition Width="136" />
				<!-- Title -->
				<ColumnDefinition />
				<!-- Help -->
				<ColumnDefinition Width="29" />
				<!-- Minimize -->
				<ColumnDefinition Width="29" />
				<!-- Maximize/Restore -->
				<ColumnDefinition Width="29" />
				<!-- Close -->
				<ColumnDefinition Width="29" />
			</Grid.ColumnDefinitions>
			<TextBlock x:Name="title"
					Text="{Binding Title, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
					HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1"
					Foreground="{DynamicResource WindowCaptionFocused}" IsHitTestVisible="False" />
			<Button x:Name="helpButton" Style="{StaticResource CaptionButton}" Grid.Column="2"
					Content="{StaticResource HelpButtonKey}" Foreground="{Binding Foreground, ElementName=title}"
					Margin="{Binding Margin, ElementName=minimizeButton}" ToolTip="Daytimer Help (F1)" Tag="1"
					Click="helpButton_Click" />
			<Button x:Name="minimizeButton" Style="{StaticResource CaptionButton}" Grid.Column="3"
					Content="{StaticResource MinimizeButtonKey}" Foreground="{Binding Foreground, ElementName=title}"
					Click="minimizeButton_Click" ToolTip="Minimize" Tag="2" />
			<Button x:Name="maximizeRestoreButton" Style="{StaticResource CaptionButton}" Grid.Column="4"
					ToolTip="Maximize" Foreground="{Binding Foreground, ElementName=title}"
					Click="maximizeRestoreButton_Click" Tag="1" Margin="{Binding Margin, ElementName=minimizeButton}" />
			<Button Style="{StaticResource CaptionButton}" Grid.Column="5" Content="{StaticResource CloseButtonKey}"
					Click="closeButton_Click" Foreground="{Binding Foreground, ElementName=title}" ToolTip="Close"
					Tag="2" Margin="{Binding Margin, ElementName=minimizeButton}" />
		</Grid>
	</Grid>
	<Image x:Name="copyWindowImg" Panel.ZIndex="10000" RenderOptions.BitmapScalingMode="LowQuality"
			IsHitTestVisible="False" Visibility="Collapsed" />
</Grid>